﻿@model UserAccount
@using FlowBasisSampleSite.Domain.Entities
@{
    var userAccount = Model;    
}

@if (userAccount.IsDeleted)
{
    <div>DELETED</div>
}

<div>
    Display Name: @userAccount.DisplayName
</div>
<div>
    Primary Email: @userAccount.PrimaryEmail
</div>
<div>
    Is Primary Email Verified: @userAccount.IsPrimaryEmailVerified
</div>
<div>
    User Token: @userAccount.UserToken
</div>
<div>
    Roles:
    @{
        int roleCount = 0;
        var roleList = new List<string>();
        foreach (var role in userAccount.Roles.OrderBy(r => r.Name))
        {
            if (roleCount > 0)
            {
                @(", ")
            }
            
            @Html.ActionLink(role.Name, "Info", "Roles", new { id = role.RoleId }, null)

            roleCount++;
        }               
    }    
</div>